/*
*  Copyright 2019-2020 Zheng Jie
*
*  Licensed under the Apache License, Version 2.0 (the "License");
*  you may not use this file except in compliance with the License.
*  You may obtain a copy of the License at
*
*  http://www.apache.org/licenses/LICENSE-2.0
*
*  Unless required by applicable law or agreed to in writing, software
*  distributed under the License is distributed on an "AS IS" BASIS,
*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*  See the License for the specific language governing permissions and
*  limitations under the License.
*/
package me.zhengjie.suli.check.domain;

import lombok.Data;
import cn.hutool.core.bean.BeanUtil;
import io.swagger.annotations.ApiModelProperty;
import cn.hutool.core.bean.copier.CopyOptions;
import javax.persistence.*;
import javax.validation.constraints.*;
import java.sql.Timestamp;
import java.math.BigDecimal;
import java.io.Serializable;

/**
* @website https://eladmin.vip
* @description /
* @author Allen Gao
* @date 2024-04-11
**/
@Entity
@Data
@Table(name="check_record")
public class CheckRecord implements Serializable {

    @Id
    @Column(name = "`id`")
    @ApiModelProperty(value = "ID")
    private String id;

    @Column(name = "`check_code`")
    @ApiModelProperty(value = "抽检编码")
    private String checkCode;

    @Column(name = "`material_code`")
    @ApiModelProperty(value = "物料编码")
    private String materialCode;

    @Column(name = "`material_name`")
    @ApiModelProperty(value = "物料名称")
    private String materialName;

    @Column(name = "`unit`")
    @ApiModelProperty(value = "单位")
    private String unit;

    @Column(name = "`plan_qty`")
    @ApiModelProperty(value = "库存数量")
    private BigDecimal planQty;

    @Column(name = "`diff_qty`")
    @ApiModelProperty(value = "盘差")
    private BigDecimal diffQty;

    @Column(name = "`check_qty`")
    @ApiModelProperty(value = "抽检数量")
    private BigDecimal checkQty;

    @Column(name = "`tray_code`")
    @ApiModelProperty(value = "载具")
    private String trayCode;

    @Column(name = "`location_code`")
    @ApiModelProperty(value = "库位")
    private String locationCode;

    @Column(name = "`lot_code`")
    @ApiModelProperty(value = "批次号")
    private String lotCode;

    @Column(name = "`pk_list`")
    @ApiModelProperty(value = "箱号")
    private String pkList;

    @Column(name = "`grade`")
    @ApiModelProperty(value = "等级")
    private String grade;

    @Column(name = "`check_status`")
    @ApiModelProperty(value = "抽检状态")
    private Integer checkStatus;

    @Column(name = "`vmi_code`")
    @ApiModelProperty(value = "是否VMI")
    private String vmiCode;

    @Column(name = "`su_no`")
    @ApiModelProperty(value = "供应商代码")
    private String suNo;

    @Column(name = "`ch_seq`")
    @ApiModelProperty(value = "项目号")
    private String chSeq;

    @Column(name = "`wa_no`")
    @ApiModelProperty(value = "工厂")
    private String waNo;

    @Column(name = "`source_code`")
    @ApiModelProperty(value = "源单号")
    private String sourceCode;

    @Column(name = "`create_by`")
    @ApiModelProperty(value = "创建用户")
    private String createBy;

    @Column(name = "`update_by`")
    @ApiModelProperty(value = "修改用户")
    private String updateBy;

    @Column(name = "`create_time`")
    @ApiModelProperty(value = "创建日期")
    private Timestamp createTime;

    @Column(name = "`update_time`")
    @ApiModelProperty(value = "修改日期")
    private Timestamp updateTime;

    public void copy(CheckRecord source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}
